package model

import (
	"gorm.io/gorm"
	"wx_build/global"
)

type Crud struct {
	gorm.Model
}

func (c *Crud) Add(data interface{}) error {
	db := global.Sqlite
	err := db.Create(data).Error
	return err
}
func (c *Crud) QueryOne(query interface{}) error {
	db := global.Sqlite
	err := db.Where(*&query).First(query).Error
	return err
}
